package edu.zut;

import java.util.*;
import java.util.Scanner;

//面向对象，员工类
public class employeerDemo {
    public static void main(String[] argc) {
        Scanner scan = new Scanner(System.in);
        int ms = scan.nextInt();
        Manager m = new Manager(ms);
        System.out.println(m.getSalary());

        int ss = scan.nextInt();
        int st = scan.nextInt();
        Salesman s = new Salesman(ss, st);
        System.out.println(s.getSalary());

        int ws = scan.nextInt();
        int wd = scan.nextInt();
        Worker w = new Worker(ws, wd);
        System.out.println(w.getSalary());
    }
}

class Employee {
    private int salary;

    public Employee(int salary) {
        this.salary = salary;
    }

    public int getSalary() {
        return salary;
    }
}

class Manager extends Employee {
    //private int salary;
    public Manager(int salary) {
        super(salary);
    }

    public int getSalary() {
        return super.getSalary();
    }
}

class Salesman extends Employee {
    private int extra;

    public Salesman(int salary, int extra) {
        super(salary);
        this.extra = extra;
    }

    public int getSalary() {
        return super.getSalary() + this.extra;
    }
}

class Worker extends Employee {
    private int day;

    public Worker(int salary, int day) {
        super(salary);
        this.day = day;
    }

    public int getSalary() {
        return super.getSalary() * this.day;
    }
}
